<template>
	<el-dialog title="信息确认并提交" :visible.sync="dialogVisible" width="700px">
		<div>
			<div v-for="(item,i) in systemGuifanFilesProcessList" :key="i">
				<div><b>文件信息({{i+1}})</b></div>
				<table class="table1 owntable" border="0" cellspacing="0" cellpadding="1">
					<tr>
						<td>文件名称</td>
						<td>{{item.name}}</td>
						<td>文件类型</td>
						<td>{{item.fileType=='0'?'医疗器械':'体系运行'}}</td>
						<td>文件编号</td>
						<td>{{item.fileNumber}}</td>
					</tr>
					<tr>
						<td>文件版本号</td>
						<td>{{item.versionNumber}}</td>
						<td>文件控制状态</td>
						<td>{{item.controlStatus=='0'?'受控':'非受控'}}</td>
						<td>内部/外来文件</td>
						<td>{{item.fileSource=='0'?'内部文件':'外来文件'}}</td>
					</tr>
					<tr>
						<td>页码数量</td>
						<td>{{item.fileNumber}}</td>
						<td>编制部门</td>
						<td colspan="4">{{userInfo.dept}}</td>
					</tr>
				</table>
				<table class="mb20 owntable" border="0" cellspacing="0" cellpadding="1">
					<tr>
						<td>文件</td>
						<td class="white_bg w550 flex_between">
							<span class="main_co pointer">{{(item.templateFile).substring((item.templateFile).lastIndexOf('/') + 1)}}</span>
							<el-button size="mini" v-if="item.isSystemCover=='1'">封面预览</el-button>
						</td>
					</tr>
				</table>
			</div>

			<div><b>流程信息</b></div>
			<table class="table1 owntable" border="0" cellspacing="0" cellpadding="1">
				<tr v-if="i%3==0" v-for="(item,i) in guifanFilesProcessRecordList" :key="i">
					<td>{{progressTypes[item.type]}}</td>
					<td
						:colspan="`${(guifanFilesProcessRecordList.length%3==1&&i==guifanFilesProcessRecordList.length-1)?5:1}`">
						{{item.userName}}</td>
					<td v-if="guifanFilesProcessRecordList[i+1]">
						{{progressTypes[guifanFilesProcessRecordList[i+1].type]}}</td>
					<td v-if="guifanFilesProcessRecordList[i+1]"
						:colspan="`${(guifanFilesProcessRecordList.length%3==2&&i==guifanFilesProcessRecordList.length-1)?3:1}`">
						{{guifanFilesProcessRecordList[i+1].userName}}</td>
					<td v-if="guifanFilesProcessRecordList[i+2]">
						{{progressTypes[guifanFilesProcessRecordList[i+2].type]}}</td>
					<td v-if="guifanFilesProcessRecordList[i+2]">{{guifanFilesProcessRecordList[i+2].userName}}</td>
				</tr>
			</table>
			<div class="pub_center">
				<el-button size="small" type="primary" @click="close()">提交</el-button>
			</div>
		</div>
	</el-dialog>
</template>

<script>
	export default {
		props: {
			type: String,
			guifanFilesProcessRecordList: [],
			systemGuifanFilesProcessList: [],
		},
		data() {
			return {
				dialogVisible: false
			}
		},
		methods: {
			init() {
				this.dialogVisible = true
			},
			close() {
				this.$emit('close')
			}
		}
	}
</script>

<style scoped="scoped">
	.table1 {
		margin-bottom: 20px;
	}

	table {
		width: 660px;
	}
</style>
